## 斐波那契数列
from datetime import datetime


# a, b, c = 0, 1, set()
#
# while b < 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:
#     print(b, end='\t')
#     c.add(b)
#     a, b = b, a + b
#
# print(len(c))


def Fibonacci(num, dic={}):
    if num in dic:
        return dic[num]

    if num <= 1:
        return num

    res = Fibonacci(num - 1, dic) + Fibonacci(num - 2, dic)
    dic[num] = res
    return dic[num]


while 100:
    val = input("请输入你想知道的斐波那契数列第几位是什么值")
    startTime = datetime.now()
    val = Fibonacci(int(val),{10000:"jing"})
    print(val, "\n", type(val))
    print(datetime.now() - startTime)
